from runtime.flow import ScriptDef, FileItem
from lib.log import logger
from lib import excel
from runtime.m import retry

def reset():
    logger.info("RESET")

@retry(num_times=3, sleep_time=1, reset_func=reset)
def print_item(item):
    logger.info(item)
    raise Exception("111")

def run(excel_file):
    data = excel.loads2dict(excel_file)
    for item in data:
        print_item(item)
        
export = ScriptDef(
            func=run,
            group="其他",
            title="测试流程EXCEL",
            arguments=[
                FileItem(title="excel文件", name="excel_file")
            ]   
         )